import { InputProps } from 'naive-ui';
import OceanComponent from '../utils/class/OceanComponent';
import useController from './useController';

function useSetting(o: OceanComponent) {
  let target = useController(o);
  return target.map(t => {
    return <T>(setting: T) => {
      let s = typeof setting === 'function' ? setting(t) : setting;
      Object.assign(t, s);
    };
  });
}

export default useSetting;
